const UserService = require('../service/UserService')
/**
 *@param {*}register 注册接口
 *@param {*}login 登录接口
 *@param {*}forget 忘记接口
 *@param {*}detail 个人信息接口
 */
const UserController = {
  register: async(req, res) => {
    const { phone, code} = req.body;
    console.log(77);
    let handleRes = await UserService.register(phone, code);
    res.send(handleRes);
  },
  login:async(req,res)=>{
    const { phone, code, passward} = req.body;
    let handleRes = await UserService.login(phone, code, passward);
    res.send(handleRes);
    return
  },
  forget:async(req, res) => {
    const { phone, code, passward} = req.body;
    let handleRes = await UserService.forget(phone, code, passward);
    res.send(handleRes);
  },
  detail:async(req, res) => {
    let handleRes =await UserService.detail(req);
    res.send(handleRes);
  },
  duration_record:async(req, res) => {
    let handleRes =await UserService.duration_record(req);
    res.send(handleRes);
  },
};
module.exports = UserController;
